package com.softtown.modules.message.service.impl;

import com.softtown.common.service.impl.BaseServiceImpl;
import com.softtown.modules.message.dao.SysEmailContentDao;
import com.softtown.modules.message.entity.SysEmailContentEntity;
import com.softtown.modules.message.service.SysEmailContentService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @version v1.0
 * @ProjectName: softtown-aioffice
 * @ClassName: SysEmailContentServiceImpl
 * @Description: 邮箱验证码Service实现层
 * @Author: fuming
 * @Date: 2019/7/11 10:04
 */
@Service
public class SysEmailContentServiceImpl extends BaseServiceImpl<SysEmailContentDao, SysEmailContentEntity> implements SysEmailContentService {

    /**
     * @Title: getByEmail
     * @Description: 根据邮箱查出信息Service实现方法
     * @param @param [email]
     * @return @return com.softtown.modules.message.entity.SysEmailContentEntity
     * @author fuming
     * @throws
     * @date 2019/7/12 19:22
     */
    @Override
    public SysEmailContentEntity getByEmail(String email) {
        return baseDao.getByEmail(email);
    }

    /**
     * @Title: saveEmail
     * @Description: 保存邮箱信息Service实现方法
     * @param @param [sysEmailContentEntity]
     * @return @return java.lang.Boolean
     * @author fuming
     * @throws
     * @date 2019/7/12 19:22
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void saveEmail(SysEmailContentEntity sysEmailContentEntity) {
        baseDao.saveEmail(sysEmailContentEntity);
    }

    /**
     * @Title: updateEmailCode
     * @Description: 更新邮箱信息Service实现方法
     * @param @param [sysEmailContentEntity]
     * @return @return java.lang.Boolean
     * @author fuming
     * @throws
     * @date 2019/7/12 19:23
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updateEmailCode(SysEmailContentEntity sysEmailContentEntity) {
        baseDao.updateEmailCode(sysEmailContentEntity);
    }
}
